define(['egis'], function (egis) {
    Window.deserializer = Window.deserializer || new egis.core.Deserializer();
    Window.container = Window.container || {};
    dsBridge.register('create_Tooltip', function (sourceId, content) {
        try{
            content = JSON.parse(content);
            var tooltip = new egis.widget.Tooltip({
                anchor: Window.deserializer.createJsInstance(content.anchor),
                content: content.content,
                id: content.id,
                layerId: content.layerId,
                offset: content.offset,
                title: content.title,
                autoPan: content.autoPan,
                className: content.className
            });
            Window.container[sourceId] = tooltip;
        }catch (e){
            alert(e)
        }
    })

    dsBridge.register('Tooltip_pieceTemplate', function (sourceId, kvs) {
        var source = Window.container[sourceId];
        kvs = Window.deserializer.createJsInstance(JSON.parse(kvs));
        source.pieceTemplate(kvs);
    })
})